﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpModelInterface.h"
#include "IObject.h"

namespace gcmp {  

    //class IGroupEvent;
    class IDocument;

    /// \brief 拷贝接口
    class GCMP_MODEL_INTERFACE_EXPORT IGroupCopyProcessor : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::IGroupCopyProcessor, gcmp::IObject);
    public:

        /// \brief 对组类型或组内的元素进行拷贝
        /// \param pDoc  IDocument指针
        /// \param srcElementId  源拷贝Element的Id
        /// \param groupId  组的ElementId
        /// \param isSyncFromTypeToGroup  是否为从组类型到组的更新。true，从组类型到组的更新；false，从组到组类型的更新
        /// \param allToTargetIds  所有源对象与新拷贝对象的ElementId映射，如果不需要该输出参数，设为nullptr
        /// \return 返回新拷贝对象的ElementId
        virtual  ElementId CopyElement(IDocument* pDoc, ElementId srcElementId, ElementId groupId, bool isSyncFromTypeToGroup, std::map<ElementId, ElementId>* allToTargetIds) const = 0;

        /// \brief 对组类型或组内的元素进行拷贝
        /// \param pDoc  IDocument指针
        /// \param srcElementIds  源拷贝对象Id的列表
        /// \param allToTargetIds  所有源对象与新拷贝对象的ElementId映射，如果不需要该输出参数，设为nullptr
        /// \return 返回新拷贝对象的Element的vector
        /// \note 正确情况下，新拷贝对象的个数应该和源拷贝对象的个数相同
        virtual  std::vector<ElementId> CopyElements(IDocument* pDoc, const std::vector<ElementId>& srcElementIds, std::map<ElementId, ElementId>* allToTargetIds) const = 0;

        virtual ~IGroupCopyProcessor();
    };
    
}// namespace gcmp
